<?php

namespace common\models\c2\entity;

use Yii;

/**
 * This is the model class for table "{{%app_version}}".
 *
 * @property integer $id
 * @property string $title
 * @property string $content
 * @property string $version
 * @property string $download_url
 * @property integer $status
 * @property string $created_at
 * @property string $updated_at
 */
class AppVersion extends \cza\base\models\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%app_version}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['version'], 'number'],
            [['created_at', 'updated_at'], 'safe'],
            [['title', 'content', 'download_url'], 'string', 'max' => 255],
            [['status'], 'integer', 'max' => 127],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => Yii::t('app.c2', 'ID'),
            'title' => Yii::t('app.c2', 'Title'),
            'content' => Yii::t('app.c2', 'Content'),
            'version' => Yii::t('app.c2', 'Version'),
            'download_url' => Yii::t('app.c2', 'Download Url'),
            'status' => Yii::t('app.c2', 'Status'),
            'created_at' => Yii::t('app.c2', 'Created At'),
            'updated_at' => Yii::t('app.c2', 'Updated At'),
        ];
    }

    /**
     * @inheritdoc
     * @return \common\models\c2\query\AppVersionQuery the active query used by this AR class.
     */
    public static function find()
    {
        return new \common\models\c2\query\AppVersionQuery(get_called_class());
    }
    
    /**
    * setup default values
    **/
    public function loadDefaultValues($skipIfSet = true) {
        parent::loadDefaultValues($skipIfSet);
    }

}
